<template>
  <div class="container">
    <div class="img">
      <el-carousel :interval="2000" type="card" height="200px">
        <el-carousel-item v-for="item in images" :key="item">
          <img :src="item.url" alt="无图片" />
        </el-carousel-item>
      </el-carousel>
    </div>
    <div class="login">
      <h1>ʚ喵管家ɞ</h1>
      <h1>一站式猫咪管理平台</h1>
      <div class="button">
        <el-button plain @click="$router.replace('/shop')">即刻拥有🐱</el-button>
        <el-button plain @click="login">已有爱宠😻</el-button>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "Carousel",
  data() {
    return {
      images: [
        { url: require("../../assets/images/banner1.png") },
        { url: require("../../assets/images/banner2.png") },
        { url: require("../../assets/images/banner3.png") },
      ],
    };
  },
  methods: {
    login() {
      this.$router.push("/loginid");
    },
  },
};
</script>

<style lang="less" scoped>
.container {
  position: relative;
  height: 100%;
  .login {
    position: absolute;
    left: 50%;
    top: 60%;
    box-shadow: 1px 1px 1px gray;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 60%;
    height: 50%;
    background-color: aliceblue;
    border-radius: 20px;
    .button .el-button:nth-child(1) {
      background-color: white;
      color: #eea2a4;
      margin-right: 10px;
    }
  }
  .login h1:nth-child(1) {
    margin: 0;
    color: rgb(255, 0, 106);
    font-size: 60px;
  }
  .login h1:nth-child(2) {
    margin: 0;
    color: rgb(255, 0, 106);
    margin-bottom: 20px;
  }
  .el-button {
    background-color: #eea2a4;
    width: 200px;
    height: 70px;
    font-size: 25px;
    color: aliceblue;
    border: 1px solid #eea2a4;
  }
    .el-button:hover {
    color: #eea2a4;
    border: 1px solid #eea2a4;
  }
}
</style>